package ar.com.larreta.grilla.client;

import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.event.EventType;
import com.extjs.gxt.ui.client.store.Store;
import com.extjs.gxt.ui.client.store.StoreEvent;

public class StoreListener<M extends ModelData> extends
		com.extjs.gxt.ui.client.store.StoreListener<M> {

	protected Grilla grilla;

	public StoreListener(){
	}
	
	public Grilla getGrilla() {
		return grilla;
	}

	public void setGrilla(Grilla grilla) {
		this.grilla = grilla;
	}
	
	public void handleEvent(StoreEvent<M> e) {
		EventType type = e.getType();
		if (type == Store.BeforeAdd) {
			storeBeforeAdd(e);
		}
		if (type == Store.BeforeRemove) {
			storeBeforeRemove(e);
		}

		super.handleEvent(e);
	}

	public void storeBeforeAdd(StoreEvent<M> se) {
	}

	public void storeBeforeRemove(StoreEvent<M> se) {
	}

}
